import React from 'react';
import { View } from 'react-native';
import MultiPickerWarp from './MultiPickerWarp';


const MultiPicker = (props) => {
  const {
    children, style,
  } = props;
  const selectedValue = props.getValue();
  const colElements = React.Children.map(children, (col, i) => {
    return React.cloneElement(col, {
      selectedValue: selectedValue[i],
      onValueChange: (...args) => props.onValueChange(i, ...args),
  });
  });
  return (
    <View style={style}>
      {colElements}
    </View>
  );
};

export default MultiPickerWarp(MultiPicker);
